drop _all
set more off
set virtual on
set memory 3g
set matsize 2000
set logtype text
capture log close
log using T2, replace

use world_child3

** keep only children with full exposure

tab infant_exp
keep if infant_exp==1

* This do file:
* 1) regresses infant mortality on height, with no controls
* 2) adds country-year dummies
* 3) adds exogenous vars (gender, religion, urban/rural)
* 4) adds poss endogenous vars (ma age at birth, birth month of child, birth order)
* 5) adds ma and fa educ

** (1)
reg infant height100, robust cluster(countryid)
sum infant height100 if e(sample)


** (2)
xi: reg infant height100 i.countryid*i.yearc, robust cluster(countryid)
sum infant height100 if e(sample)

** (3)
xi: reg infant height100 malec urban christian muslim otherrel i.countryid*i.yearc, robust cluster(countryid)
sum infant height100 if e(sample)

** (4)
xi: reg infant height100 malec urban christian muslim otherrel cbirthmth2-cbirthmth12 chld2-chld3 chldm4 age915 age1618 age2530 age3149 i.countryid*i.yearc, robust cluster(countryid)
sum infant height100 if e(sample)

** (5)
xi: reg infant height100 malec urban christian muslim otherrel cbirthmth2-cbirthmth12 chld2-chld3 chldm4 age915 age1618 age2530 age3149 educf2-educf4 educm2-educm4 i.countryid*i.yearc, robust cluster(countryid)
sum infant height100 if e(sample)

log close
exit